home *** CD-ROM | disk | FTP | other *** search
/ Acorn User: China / Acorn User China CD-ROM (UK) (Disc B) / Acorn User China CD-ROM (UK) (Disc B).bin / BARNET / ARMLINUX / MAIL / 9801 / text0018.txt < prev    next >
Encoding:
Text File  |  1998-01-31  |  1.1 KB  |  29 lines

  1. > BTW, for those of you using the new GCC, something that has been discovered
  2. > by Dave Gilbert:
  3. >  When compiling the kernel, turn off some of the optimisations, specifically
  4. >  the one that allows GCC/EGCS to assume that all structures are word aligned.
  5. >  GCC will try to load a short using a LDR with a shift.  EG, to access bytes
  6. >  12 and 13 only of a structure, GCC will use by default:
  7. >    ldr r0, [r1, #14]
  8. >    mov r0, r0, lsr #16
  9. >  This means that if r1 isn't word aligned (it certainly isn't for IP ethernet
  10. >  packets in this case), the LDR picks up the wrong data.
  11. > Does anyone know if this is a legal optimisation that the compiler is making?
  12.  
  13. All you need to add is -mshort-load-bytes to the command line.  Phil told
  14. me about this one already.
  15.  
  16. > BTW, don't say that it should be word aligned.  If that structure was word
  17. > aligned, then the IP structures won't be, which will be even worse.  Blame
  18. > Xerox for that one!
  19.  
  20. Cuh, those Xerox guys, hey?  Fancy not optimising a network protocol for
  21. a 32 bit CPU due to be designed in 20 years time.. ;-)
  22.  
  23. unsubscribe: body of `unsubscribe linux-arm' to majordomo@vger.rutgers.edu
  24.  
  25.